package com.eco.fanliapp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.eco.fanliapp.dao.RoleInfoMenusMapper;
import com.eco.fanliapp.entity.RoleInfoMenus;
import com.eco.fanliapp.service.IRoleInfoMenusService;
import com.eco.fanliapp.utils.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色权限 服务层实现
 * 
 * @author xiaoxx
 * @date 2019-05-20
 */
@Service
public class RoleInfoMenusServiceImpl extends ServiceImpl<RoleInfoMenusMapper, RoleInfoMenus> implements IRoleInfoMenusService
{
	@Autowired
	private RoleInfoMenusMapper roleInfoMenusMapper;

	/**
     * 查询角色权限信息
     * 
     * @param roleinfoId 角色权限ID
     * @return 角色权限信息
     */
    @Override
	public RoleInfoMenus selectRoleInfoMenusById(Integer roleinfoId)
	{
	    return roleInfoMenusMapper.selectRoleInfoMenusById(roleinfoId);
	}
	
	/**
     * 查询角色权限列表
     * 
     * @param roleInfoMenus 角色权限信息
     * @return 角色权限集合
     */
	@Override
	public List<RoleInfoMenus> selectRoleInfoMenusList(RoleInfoMenus roleInfoMenus)
	{
	    return roleInfoMenusMapper.selectRoleInfoMenusList(roleInfoMenus);
	}
	
    /**
     * 新增角色权限
     * 
     * @param roleInfoMenus 角色权限信息
     * @return 结果
     */
	@Override
	public int insertRoleInfoMenus(RoleInfoMenus roleInfoMenus)
	{
	    return roleInfoMenusMapper.insertRoleInfoMenus(roleInfoMenus);
	}
	
	/**
     * 修改角色权限
     * 
     * @param roleInfoMenus 角色权限信息
     * @return 结果
     */
	@Override
	public int updateRoleInfoMenus(RoleInfoMenus roleInfoMenus)
	{
	    return roleInfoMenusMapper.updateRoleInfoMenus(roleInfoMenus);
	}

	/**
     * 删除角色权限对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteRoleInfoMenusByIds(String ids)
	{
		return roleInfoMenusMapper.deleteRoleInfoMenusByIds(Convert.toStrArray(ids));
	}
	
}
